<template>
	<view id="certIput">
		<Header txt="实名认证" v-if="baidu"></Header>
		<HeaderB txt="实名认证" v-if="!baidu"></HeaderB>
		<view class="dislog" v-if="isChose">
			<view class="tit2">
				<view class="top">
					对公账户打款方式
				</view>
				<view  @click="radioC(2)" :class="radio==2?'content content2':'content' ">
					<view class="imtm left">
						<radio  :value="String(radio)" :checked="radio==2" />
					</view>
					<view class="imtm right">
						<view class="imtm1">
							我将打款至梦琪科技的对公账户
						</view>
						<view class="imtm2">
							我将向梦琪科技的对公账户转入随机金额（0.01~0.99）元，审核
							速度较快
						</view>
					</view>
				</view>
				<view class="content"@click="radioC(1)" :class="radio==1?'content content2':'content' ">
					<view class="imtm left">
						<radio  :value="String(radio)" :checked="radio==1" />
					</view>
					<view class="imtm right">
						<view class="imtm1">
							梦琪科技将打款至我的对公账户
						</view>
						<view class="imtm2">
							梦琪科技将通过中国工商银行向我的对公账户转入随机金额（0.01
							~0.99）元，0-2天到账
						</view>
					</view>
				</view>
				<view class="bottom">
					<button class="btn2" type="primary" @click="closeY">取消</button>
					<button class="btn1" type="primary" @click="closeX">确定</button>
				</view>
			</view>
		</view>
		<view class="top-tit">
			 实名认证决定了账号归属，请根据实际情况进行实名认证
		</view>
		<!-- <ms-tabs :list="list" v-model="active" v-if="searchMenu"></ms-tabs>
		 -->
		 <view class="texttop">
		 	<view v-bind:class="{'item':true, 'itm1':isA}" @click="goA">
				<view class="white1">
				</view>
				<view class="white2">
				</view>
		 		个人认证
		 	</view>
		 	<view :class="{'item':true, 'itm1':isB}" @click="goB">
		 		企业认证
				<view class="white1">
				</view>
				<view class="white2">
				</view>
		 	</view>
		 </view>
		<view class="content" v-if="isA&&isWx">
			<view class="items" @click="zhiCert" v-if="cert.status == 0 && zhi_cert == false && san_cert == false&&isWx==true">
				<image src="" mode="aspectFit"></image>
				<view class="code_ceList_tit">
					<text class="code_ceList_text">扫码认证</text><br>
					<text class="code_ceList_text02">通过刷脸认证</text>
				</view>
				<view class="icon">
					
				</view>
			</view>
			<view class="items" @click="sanCert" v-if="cert.status == 0 && zhi_cert == false && san_cert == false">
				<image src="" mode="aspectFit"></image>
				<view class="code_ceList_tit">
					<text class="code_ceList_text">三要素认证</text><br>
					<text class="code_ceList_text02">通过姓名、手机号、身份证号认证</text>
				</view>
				<view class="icon">					
				</view>
			</view>
			<view class="free_num" v-if="cert.status == 0 && zhi_cert == false && san_cert == false">
				免费认证三次，剩余认证次数：{{ numberCount }}
			</view>
			<view class="items" @click="reviewCert" v-if="cert.status == 0 && zhi_cert == false && san_cert == false">
				<image src="" mode="aspectFit"></image>
				<view class="code_ceList_tit">
					<text class="code_ceList_text">人工证件审核认证</text><br>
					<text class="code_ceList_text02">通过姓名、手机号、身份证号认证</text>
				</view>
				<view class="icon">
					
				</view>
			</view>
			<view class="" v-show="san_cert">
				<text>手机号码</text>
				<input type="text" value="" placeholder="请输入手机号码" v-model="ruleForm2.mobile" />
				<text>真实姓名</text>
				<input type="text" value="" placeholder="请输入姓名" v-model="ruleForm2.certName" />
				<text>身份证号</text>
				<input type="text" value="" placeholder="请输入身份证号" v-model="ruleForm2.certNo" />
				<button type="primary" @click="subCert()">开始认证</button>
			</view>
			<view class="" v-show="zhi_cert">				
				<text>真实姓名</text>
				<input type="text" value="" placeholder="请输入姓名" v-model="ruleForm.certName" />
				<text>身份证号</text>
				<input type="text" value="" placeholder="请输入身份证号" v-model="ruleForm.certNo" />
				<button type="primary" @click="getCert">下一步 人脸识别</button>
			</view>
			<view class="finsh" v-if="cert.status == 1">
				<image src="https://iconimg.oss-cn-hangzhou.aliyuncs.com/%E7%86%8A%E7%8C%AB%E4%BB%A3%E7%90%86/%E7%94%A8%E6%88%B7/bg_icon11.png" mode="aspectFit"></image>
				<view v-if="cert.type == 2">恭喜你完成个人三要素认证！</view>
				<view v-if="cert.type == 1">恭喜你完成个人刷脸认证！</view>
				<view v-if="cert.type == 3">恭喜你完成人工审核认证！</view>
				<view class="content"v-if="cert.type == 2">
					<view class="lists">
						电话号码
					</view>
					<view class="lists lists2">
						{{ ruleForm2.mobile }}
					</view>
				</view>
				<view class="content">
					<view class="lists">
						真实姓名
					</view>
					<view class="lists lists2">
						{{ cert.certName}}
					</view>
				</view>
				<view class="content">
					<view class="lists">
						身份证号
					</view>
					<view class="lists lists2">
						{{ cert.certNo}}
					</view>
				</view>
				<view class="content"v-if="cert.type == 3">
					<view class="lists">
						上传证件照片
					</view>
					<view class="lists lists2">
						已通过
					</view>
				</view>
				<!-- <button type="primary">购买</button> -->
			</view>
		</view>
		<view class="content" v-if="isB">

			<view class="certCom" v-if="certCom.status == 0 || certCom.status == 2 || certCom.status == 1">			
				<view class="top" v-if="certCom.status == 0">
					<view class="img">
					</view>
					<view>很遗憾，企业认证未通过</view>
				</view>
				<view class="top" v-if="certCom.status == 2">
					<view class="img2">
					</view>
					<view>恭喜你完成企业认证！</view>
				</view>
				<view class="item">
					<text>企业名称</text>
					<view class="input">{{ certCom.business }}</view>
				</view>
				<view class="item">
					<text>营业执照注册号</text>
					<view class="input">{{ certCom.licenseNo }}</view>
				</view>
				<view class="item">
					<text>营业执照扫描件</text>
					<view class="input input2" >
						<text class="input3" v-if="certCom.status == 2">已通过</text>
						<text  v-if="certCom.status == 0&&certCom.type == 1 &&certCom.workflow == 1">{{certCom.failExplain}}</text>
						<text  v-if="certCom.status == 1 &&certCom.workflow == 1&&certCom.type == 1">审核中</text>
						<text  v-if="certCom.status == 1 &&certCom.workflow == 2&&certCom.type == 2">审核中</text>
						<text  v-if="certCom.status == 0&&certCom.type == 2 &&certCom.workflow == 2">{{certCom.failExplain}}</text>
					</view>
				</view>
				<view class="item">
					<text>打款金额</text>
					<view class="input input2">
						<text class="input3" v-if="certCom.status == 2">已通过</text>
						<text  v-if="certCom.status == 1">审核中</text>
						<text  v-if="certCom.status == 0&&certCom.type == 1 &&certCom.workflow == 2">{{certCom.failExplain}}</text>
						<text  v-if="certCom.status == 0&&certCom.type == 2 &&certCom.workflow == 3">{{certCom.failExplain}}</text>
					</view>
				</view>
				<view class="item" v-if="certCom.type==1">
					<text>银行卡号</text>
					<view class="input">
						{{certCom.bankAccount}}
					</view>
				</view>
				<view class="item">
					<text>联系人电话</text>
					<view class="input">
						{{certCom.mobile}}
					</view>
				</view>
				<view class="item"  v-if="certCom.status == 0">
					<text>未通过原因</text>
					<view class="input">
						{{certCom.failExplain}}
					</view>
				</view>
				<view class="bottom"  v-if="certCom.status == 1 || certCom.status == 0">
					<button type="primary" @click="chongRen">重新认证</button>
					<text v-if="certCom.status == 0">您填写的信息有误，请进行重新认证</text>
				</view>
				<view class="bottom"  v-if="certCom.status == 2 ">
					<button type="primary"  @click="goBuy">进入购买页</button>
					<text>您已经完成实名认证，请放心购买继续使用吧</text>
				</view>
			</view>
			<view class="" v-if="!show_next && !show_next2">
				<view class="" v-if="certCom.status == 4">
					<text>企业名称</text><br>
					<input type="text" value="" placeholder="请输入企业名称" v-model="ruleForm.cerComtName" />
					<text>营业执照注册号</text>
					<input type="text" value="" placeholder="请输入营业执照注册号" v-model="ruleForm.cerComtNo" />
					<text>营业执照扫描件</text>
					<button type="" @click="handSuccess" class="onload">+选择图片进行上传</button>
					<text class="titb">1.请提供证件的原件照片或者彩色扫描件（正副本均可），文字/盖章清晰可辨认</text><br>
					<text class="titb">2.格式要求jpg、png，不超过2M</text><br>
					<view class="toolIg" v-if="isShow">
						<view class="image">
							<image :src="ruleForm.imageUrl" mode=""></image><br>
						</view>			
					</view>
					<text class="next">联系人电话（非必填）</text>
					<input type="text" value="" placeholder="请输入电话" v-model="ruleForm.cerComtmobile" />
					<button type="primary" @click="getComCert(2)">下一步 修改审核</button>
				</view>	
				<view class="" v-if="certCom.status == 3">
					<text>企业名称</text>
					<input type="text" value="" placeholder="请输入企业名称" v-model="ruleForm.cerComtName" />
					<text>营业执照注册号</text>
					<input type="text" value="" placeholder="请输入营业执照注册号" v-model="ruleForm.cerComtNo" />
					<text>营业执照扫描件</text>
					<button type="" @click="handSuccess" class="onload">+选择图片进行上传</button>
					<text class="titb">1.请提供证件的原件照片或者彩色扫描件（正副本均可），文字/盖章清晰可辨认</text><br>
					<text class="titb">2.格式要求jpg、png，不超过2M</text><br>
					<view class="toolIg" v-if="isShow">
						<view class="image">
							<image :src="ruleForm.imageUrl" mode=""></image><br>
						</view>			
					</view>
					<text class="next">联系人电话（非必填）</text>
					<input type="text" value="" placeholder="请输入电话" v-model="ruleForm.cerComtmobile" />
					<button type="primary" @click="getComCert(1)">下一步 输入对公账户信息</button>
				</view>
			</view>		
			<view class="" v-if="show_next">
				<text>银行开户名</text>
				<input type="text" value="" placeholder="银行开户名和企业名称保持一致" v-model="ruleForm.cerComtName" />
				<text>银行账号</text>
				<input type="text" value="" placeholder="请输入企业对公账号" v-model="ruleForm.bankAccount" />
				<text>开户银行</text>
				<input type="text" value="" placeholder="请输入开户银行" v-model="ruleForm.bankName" />
				<text>银行所在地</text>
				<uni-data-picker :localdata="items" popup-title="请选择城市" @change="onchange" @nodeclick="onnodeclick"></uni-data-picker>
				<text>开户支行</text>
				<input type="text" value="" placeholder="请输入开户支行" v-model="ruleForm.bankBranch" />
				<!-- <button type="primary" v-if="isChose==true" @click="getComCertNext">确定</button> -->
				<button type="primary" v-if="isChose==false" @click="open(1)">确定</button>
			</view>
			<view class="" v-if="show_next2">
				<text>银行开户名</text>
				<input type="text" value="" placeholder="银行开户名和企业名称保持一致" v-model="ruleForm.cerComtName" />
				<text>银行账号</text>
				<input type="text" value="" placeholder="请输入企业对公账号" v-model="ruleForm.bankAccount" />
				<text>开户银行</text>
				<input type="text" value="" placeholder="请输入开户银行" v-model="ruleForm.bankName" />
				<text>银行所在地</text>
				<uni-data-picker :localdata="items" popup-title="请选择城市" @change="onchange" @nodeclick="onnodeclick"></uni-data-picker>
				<text>开户支行</text>
				<input type="text" value="" placeholder="请输入开户支行" v-model="ruleForm.bankBranch" />
				<!-- <button type="primary" v-if="isChose==true" @click="getComCert2">确定</button> -->
				<button type="primary" v-if="isChose==false" @click="open(2)">确定</button>
			</view>
		</view>
	</view>
</template>

<script>
	import {District} from '../../common/city.js';
	export default {
		data() {
			return {
				items: District,
				radio:'2',
				isChose:false,
				numberCount:0,
				searchMenu:true,
				 list: [{
						title: '个人认证'
				        },{
						title: '个人认证'
				        }],
				active:0,
				cert: {
				        certName: "",
				        certNo: "",
				        status: "",
				        type: 1,
				      },
				zhi_cert:false,
				san_cert:false,
				ruleForm2: {
				        certNo: "",
				        certName: "",
				        mobile: "",
				      },
				ruleForm: {
				        certNo: "",
				        certName: "",
				        cerComtNo: "",
				        cerComtName: "",
				        cerComtmobile: "",
				        imageUrl: "",
				        mobile: "",
				        bankOpenName: "",
				        bankAccount: "",
				        bankName: "",
				        bankBranch: "",
				        bankLocation: "",
				      },
				isA:true,
				isB:false,
				show_next:false,
				show_next1:false,
				show_next2:false,
				isShow:false,
				cert2:{},
				certCom:{
					status:""
				},
				isWx:true,
				isindex:1,
				baidu:true
			};
		},
		watch:{
		    },
		onShow() {
			this.getVertifyCount()
			this.getUserdata()
			this.BusinessCetifyGet()
			this.getCertOk()
			console.log(this.certCom);
			// #ifdef MP-WEIXIN
				this.isWx=false
			// #endif
			// #ifdef MP-BAIDU
			this.baidu=false
			// #endif
		},
		methods: {
			goBuy(){
				uni.switchTab({
				    url: '/pages/buy/buy'
				});
			},
			radioC(row){
				this.radio=row
			},
			closeX(row){
				this.isChose=false
				if(this.show_next2){
					this.getComCert2()
				}
				if(this.show_next){
					this.getComCertNext()
				}
			},
			closeY(row){
				this.isChose=false
			},
			open(num){
				let that = this;
				var bankAccount = this.ruleForm.bankAccount;
				var bankName = this.ruleForm.bankName;
				var bankLocation = this.ruleForm.bankLocation;
				var bankBranch = this.ruleForm.bankBranch;
				if (bankAccount == "") {
				  this.$store.commit("SET_ERRORINFORMATION", {
				    mes: "请输入企业对公账号",
				    icon: "error",
				  });
				  return false;
				}
				if (bankName == "") {
				  this.$store.commit("SET_ERRORINFORMATION", {
				    mes: "请输入开户银行",
				    icon: "error",
				  });
				  return false;
				}
				if (bankLocation == "") {
				  this.$store.commit("SET_ERRORINFORMATION", {
				    mes: "请选择城市",
				    icon: "error",
				  });
				  return false;
				}
				if (bankBranch == "") {
				  this.$store.commit("SET_ERRORINFORMATION", {
				    mes: "请输入开户支行名称",
				    icon: "error",
				  });
				  return false;
				} 
				this.isChose=true
				this.isindex=num
			},
			chongRen() {
			    this.certCom.status = 4;
			},
			BusinessCetifyGet(){
				let that = this;
				this.$store
				  .dispatch("BusinessCetifyGet")
				  .then((response) => {					  
					let data = response.data;
					if(typeof data.obj == "undefined" || typeof data.obj.status == "undefined"){
						this.certCom.status = 3;				
					}else {						
					    that.certCom = data.obj;
						console.log(that.certCom);
					}				
				  })
				  .catch(() => {});
			},
			onchange(e) {
			    const value = e.detail.value
				let str				
				str=value[0].text+value[1].text	
				this.ruleForm.bankLocation =str	
			},
			goA(){
				this.isA=true
				this.isB=false
			},
			goB(){
				this.isB=true
				this.isA=false
			},
			getUserdata(){
				let that = this;
				this.$store
				  .dispatch("GetInfo")
				  .then((response) => {
					that.ruleForm2.mobile = response.mobile;
				  })
				  .catch(() => {});
			},
			getVertifyCount(){
				let that = this;
				this.$store
				  .dispatch("GetVertifyCount")
				  .then((response) => {
					if(response.data.code==0){
						this.numberCount=response.data.obj				
					}
				  })
				  .catch(() => {});
			},
			getCertOk(){
				let that = this;
				this.$store
				  .dispatch("GetCertOk")
				  .then((response) => {			
					if(response.data.code==0){
						let data=response.data.obj
						if (data.status == 1) {
						    // console.log("认证成功");
						    that.cert.certName = data.certName;
						    that.cert.certNo = data.certNo;
						    that.cert.status = data.status;
						    that.cert.type = data.type;
						}else {
							that.cert.status = data.status;
							return false;
						}        
					}
				  })
				  .catch(() => {});
			},
			zhiCert() {
			  if (this.numberCount > 0) {
			    this.zhi_cert = true;
			    this.san_cert = false;			
			  } else if (this.numberCount == 0) {
			    uni.showModal({
			    	title: "个人认证免费次数已用尽",
			    	content:"是否购买后再进行认证",
			    	confirmText:'确定'
			    })
			  }
			}, 
		    sanCert() {
		      if (this.numberCount > 0) {
		        this.zhi_cert = false;
		        this.san_cert = true;
		      } else if (this.numberCount == 0) {
		        uni.showModal({
		        	title: "个人认证免费次数已用尽",
		        	content:"是否购买后再进行认证",
		        	confirmText:'确定'
		        })
		      }
		    },
			reviewCert(){
				if (this.numberCount > 0) {
				    uni.navigateTo({
				    	url: "/pages/user/reviewCert"
				    })
				} else if (this.numberCount == 0) {
				        // this.showNoNum = true;
					uni.showModal({
						title: "个人认证免费次数已用尽",
						content:"是否购买后再进行认证",
						confirmText:'确定'
					})
				}
			},
			//三要素认证
			telVertify(){
				let that = this;
				this.$store
				  .dispatch("TelVertify",this.ruleForm2)
				  .then((response) => {	
					  console.log(123,response)
					if(response.data.code==0){
						uni.showToast({
							title:"认证成功"
						})
						this.getCertOk()
						that.zhi_cert = false;
						that.san_cert = false;
						setTimeout(()=>{
							uni.navigateTo({
								url: "/pages/user/certIput"
							})
						},600);							  
					}else{
						uni.showModal({
						    content: response.data.msg,
						});
					}
				  })
				  .catch(() => {});
			},
		    getCert() {				
		      let that = this;
		      var reg = /^(\d{15}$|^\d{17}(\d|X|x))$/;
		      var regs = /^(([a-zA-Z+\.?\·?a-zA-Z+]{2,30}$)|([\u4e00-\u9fa5+\·?\u4e00-\u9fa5+]{2,30}$))/;
		      var certN = this.ruleForm.certNo;
		      var certNa = this.ruleForm.certName;
		      if (certNa == "" || !regs.test(certNa)) {
		        this.$store.commit("SET_ERRORINFORMATION", {
		          mes: "请输入正确姓名",
		          icon: "error",
		        });
		        return false;
		      }
		      if (certN == "" || !reg.test(certN)) {
		        this.$store.commit("SET_ERRORINFORMATION", {
		          mes: "请输入正确身份证号码",
		          icon: "error",
		        });
		        return false;
		      } else {				  
		        this.$store
		          .dispatch("GetCertifyUrl", this.ruleForm)
		          .then((response) => {
					  if(response.data.code==0){
						  this.$store.commit("SET_CERT", true);
						  let certUrl = response.data.obj;
						  uni.navigateTo({
						  	url: '/pages/tool/showhfive?url='+certUrl
						  })
					  }else{
						 this.$store.commit("SET_ERRORINFORMATION", {
						   mes: response.data.msg,
						   icon: "error",
						 }); 
					  }
		            
		          })
		          .catch(() => {});
		      }
		    },
			img(file){
				let that=this
				let sr=file
				 uniCloud.uploadFile({
				    filePath: sr,
				    cloudPath: 'sr.jpg',
				    success(res) {
						that.ruleForm.imageUrl=res.fileID
				    },
				    fail(res) {
					},
				    complete() {}
				});
			},
			handSuccess(){
				let that=this
				uni.chooseImage({
				    count: 1, //默认9
				    sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图，默认二者都有
				    sourceType: ['album','camera'], //从相册选择
				    success: function (res) {											
						// #ifdef MP-ALIPAY
						let resimg=res.apFilePathsV2[0]
						// #endif 
						// #ifndef MP-ALIPAY
						let file=res.tempFiles[0]
						let isJPG =
						  file.type === "image/jpeg" ||
						  file.type === "image/jpg" ||
						  file.type === "image/png";
						let isLt2M = file.size / 1024 / 1024 <2;
						// if (!isJPG) {
						// 	that.$store.commit("SET_ERRORINFORMATION", {
						// 	  mes: "上传图片只能是 JPG或者png 格式!",
						// 	  icon: "error",
						// 	});			  
						// 	return false;
						// }
						if (!isLt2M) {
							that.$store.commit("SET_ERRORINFORMATION", {
							  mes: "上传图片大小不能超过 2MB!",
							  icon: "error",
							});
							return false;			  
						}
						let resimg=res.tempFilePaths[0]
						// #endif
						that.img(resimg)
						that.isShow=true
				    }
				});
			},
			//企业认证第二步
			getComCertNext() {				
			    let that = this;
				this.$store
				  .dispatch({
					 type:"BusinessCetify",
					  business: this.ruleForm.cerComtName,
					  licenseNo:this.ruleForm.cerComtNo,
					  license:this.ruleForm.imageUrl,
					  mobile:this.ruleForm.cerComtmobile,
					  bankAccount:this.ruleForm.bankAccount,
					  bankOpenName:this.ruleForm.cerComtName,
					  bankLocation:encodeURI(that.ruleForm.bankLocation),
					  bankName:this.ruleForm.bankName,
					  bankBranch:this.ruleForm.bankBranch,
					  types:that.radio
				   })
				  .then((response) => {
					  if(response.data.code==0){
						that.show_next = false;
						// that.$store.commit("SET_ERRORINFORMATION", {
						//    mes: "提交成功",
						//    icon: "success",
						//  }); 
						 if(that.radio==1){
							 uni.navigateTo({
							 	url: "/pages/user/certificationMoney"
							 }) 
						 }else{
							 uni.navigateTo({
							 	url: "/pagesA/user/certificationMoneyS"
							 }) 
						 }
						
					  }
				  })
				  .catch(() => {});	
			      
			},
			//企业重新认证
			getComCert2(){
				let that = this;
			    that.$store
			      .dispatch({
			    	 type:"BusinessCetifyUpdate",
			    	  business: that.ruleForm.cerComtName,
			    	  licenseNo:that.ruleForm.cerComtNo,
			    	  license:that.ruleForm.imageUrl,
			    	  mobile:that.ruleForm.cerComtmobile,
			    	  bankAccount:that.ruleForm.bankAccount,
			    	  bankOpenName:that.ruleForm.cerComtName,
			    	  bankLocation:encodeURI(that.ruleForm.bankLocation),
			    	  bankName:that.ruleForm.bankName,
			    	  bankBranch:that.ruleForm.bankBranch,
			    	  types:that.radio
			       })
			      .then((response) => {
			    	  
			    	  if(response.data.code==0){
			    		 // that.$store.commit("SET_ERRORINFORMATION", {
			    		 //   mes: "下一步进行打款",
			    		 //   icon: "提交成功",
			    		 // }); 
			    		if(that.radio==1){
			    			uni.navigateTo({
			    				url: "/pages/user/certificationMoney"
			    			}) 							
			    		}else{
			    			uni.navigateTo({
			    				url: "/pagesA/user/certificationMoneyS"
			    			}) 							 
			    		}
			    	  }
			      })
			      .catch(() => {});    
			},
			// 企业认证第一步
			getComCert(row){
				console.log(row);
				this.isindex=row
				let that = this;
				      var certCom = this.ruleForm.cerComtNo;
				      var certComNa = this.ruleForm.cerComtName;
				      var image = this.ruleForm.imageUrl;
				      if (certComNa == "") {
				        that.$store.commit("SET_ERRORINFORMATION", {
				          mes: "请输入企业名称",
				          icon: "error",
				        });
				        return false;
				      }
					  if (certCom == "") {
					    that.$store.commit("SET_ERRORINFORMATION", {
					      mes: "请输入营业执照注册号",
					      icon: "error",
					    });
					    return false;
					  }		      
				      if (image == "") {
				        that.$store.commit("SET_ERRORINFORMATION", {
				          mes: "请上传图片",
				          icon: "error",
				        });
				        return false;
				      } else {
						  if(row==1){
							that.show_next = true;
							that.show_next2 = false;
						  }else{
							that.show_next2 = true; 
							that.show_next = false;
						  }
				      }
			},
			subCert() {
			  let that = this;
			  var reg = /^(\d{15}$|^\d{17}(\d|X|x))$/;
			  var regs = /^(([a-zA-Z+\.?\·?a-zA-Z+]{2,30}$)|([\u4e00-\u9fa5+\·?\u4e00-\u9fa5+]{2,30}$))/;
			  var certN = this.ruleForm2.certNo;
			  var certNa = this.ruleForm2.certName;
			  let _params={
			    certName:certNa,
			    certNo:certN
			  }
			  if (certNa == "" || !regs.test(certNa)) {
			    this.$store.commit("SET_ERRORINFORMATION", {
			      mes: "请输入正确姓名",
			      icon: "error",
			    });
			    return false;
			  }
			  if (certN == "" || !reg.test(certN)) {
			    this.$store.commit("SET_ERRORINFORMATION", {
			      mes: "请输入正确身份证号码",
			      icon: "error",
			    });
			    return false;
			    // let prams = {};
			  } else {
			    // 判断认证信息是否跟上次一致
				this.$store
				  .dispatch("VertifyInfoIsSame",this.ruleForm2)
				  .then((response) => {	
					if(response.data.code==0){
						if(response.data.obj==true){
							uni.showModal({
							    title: '认证信息重复',
							    content: '您填写的认证信息重复与上一次完全一致，你确定要使用当前信息继续验证么？',
								cancelText:'重新输入',
								confirmText:'继续认证',
							    success: function (res) {
							        if (res.confirm) {
							            console.log('用户点击确定');
										that.telVertify()
							        } else if (res.cancel) {
							           // 重新输入
							            that.ruleForm2.certNo=""
							            that.ruleForm2.certName=""
							        }
							    }
							});
						}else{
							that.telVertify()
						}
					}
				})
			  }
			},    
		},
	}
</script>

<style lang="less">
	#certIput{
		background: #FFFFFF;
		.top-tit{
			text-align: center;
			color: #999999;
			font-size: 24rpx;
		}
		.select{
			border: none;
		}
		.texttop{
			margin-bottom: 30rpx;
			.item{
				display: inline-block;
				width: 50%;
				text-align: center;
				padding: 20rpx 0;
				position: relative;
			}
			.white1{
				position: absolute;
				width: 15%;
				height: 100%;
				background: #FFFFFF;
				top: 10rpx;
				left: 0;
			}
			.white2{
				position: absolute;
				width: 15%;
				height: 100%;
				background: #FFFFFF;
				top: 10rpx;
				right: 0;
			}
			.itm1{
				color: #007AFF;		
				border-bottom: 2rpx solid #007AFF;
			}
		}
		.dislog{
			position: fixed;
			width: 100%;
			height: 100%;
			background: rgba(0, 0, 0, 0.3);
			// opacity: 0.4;
			z-index: 2;
		}
		.tit2{
			width: 600rpx;
			height: 600rpx;
			background: #FFFFFF;
			position: fixed;
			margin: 0 auto;
			top: 50%;
			left: 50%;
			transform: translate(-50%,-50%);
			padding: 20rpx;
			border-radius: 10rpx;
			.top{
				text-align: center;
			}
			.txt{
				width: 200rpx;
				font-size: 36rpx;
				text-align: left;
				color: #303133;
				float: none;
			}
			.content{
				width: 100%;
				height: 200rpx;
				border: 2rpx solid #C0C0C0;
				margin: 20rpx 0 30rpx;
				border-radius: 8rpx;
				overflow: hidden;
				padding: 30rpx;
				box-sizing: border-box;
			}
			.content2{
				border: 2rpx solid #3B68F8;
			}
			.imtm{
				display: inline-block;
				width: 10%;
				height: 100%;
				float: left;
			}
			.imtm1{
				font-size: 28rpx;
				font-family: Microsoft YaHei;
				font-weight: 400;
				color: #333333;
			}
			.imtm2{
				font-size: 24rpx;
				font-family: Microsoft YaHei;
				font-weight: 400;
				color: #999999;
				margin-top: 28rpx;
			}
			.left{
				line-height: 130rpx;
				// padding-left: 50rpx;
			}
			.right{
				box-sizing: border-box;
				padding-left: 30rpx;
				width: 90%;
			}
			.bottom{
				text-align: center;
			}
			button{
				display: inline-block;
				width: 20% !important;
				font-size: 24rpx;
				border-radius: 6rpx;
				margin: 0 20rpx;
			}
			.btn1{
				background-color: #3373FC;
			}
			.btn2{
				background-color: #999999;
			}
		}
		.content{
			width: 90%;
			margin: 0 auto;
			.certCom{
				.top{
					text-align: center;
					margin-bottom: 50rpx;
				}
				.img{
					width: 100%;
					height: 100rpx;
					background: url() no-repeat center;
					background-size: 100rpx;
					text-align: center;
				}
				.img2{
					width: 100%;
					height: 100rpx;
					background: url() no-repeat center;
					background-size: 100rpx;
					text-align: center;
				}
				.item{
					margin: 20rpx 0 50rpx;
				}
				.bottom{
					text-align: center;
					padding: 20rpx 0;
				}
				button{
					margin-bottom: 20rpx;
					width: 60%;
				}
				.input{
					height: 90rpx;
					line-height: 90rpx;
					border-bottom: 2rpx solid #e4e5ed;
				}
				.input2{
					color: red;
				}
				.input3{
					color: green;
				}
			}
			.popupTxt{
				width: 100%;
				background: #FFFFFF;
				.contxt{
				    padding: 0rpx 40rpx 300rpx;
				    background: #FFFFFF;
				}
				.top{
					text-align: center;
					margin-bottom: 40rpx;
				}
			}
			.onload{
				margin: 20rpx 0;
				outline: none;
				border: 2rpx solid #007AFF;
				color: #007AFF;
			}
			.titb{
				font-size: 24rpx;
				color: #999999;
			}
			.toolIg{
				width: 100%;
				overflow: hidden;
				.image{
					width: 60rpx;
					image{
						// width: 100%;
					}
				}
				text{
					display: inline-block;
					width: 60%;
					text-overflow:ellipsis;
					white-space:nowrap;
					line-height: 126rpx;
					margin-left: 30rpx;
					color: #606266;
					margin-right: 80rpx;
					overflow: hidden;
				}
			}
			.next{ 
				padding-top: 10rpx;
			}
			.items{
				position: relative;
				height: 164rpx;
				border: 1px solid #e3e3e3;
				padding: 26rpx 36rpx;
				margin-bottom: 48rpx;
				margin-top: 20rpx;
			}
			.items:nth-child(2){
				margin-bottom: 80rpx;
			}
			.free_num{
				color: #999999;
				padding-bottom: 80rpx;
				font-size: 24rpx;
			}
			input{
				width: 100%;
				height: 96rpx;
				font-size: 28rpx;
				color: #555;
				background: #FFFFFF;
			}
			image{
				width: 164rpx;
				height: 164rpx;
				float: left;
			}
			.code_ceList_tit{
				float: left;
				margin-left: 48rpx;
				margin-top: 36rpx;
			}
			.code_ceList_text{
			    font-size: 26rpx;
			    font-weight: bold;
			    color: #222222;	
			}
			.code_ceList_text02{
			    font-size: 24rpx;
			    color: #999999;	
			}
			.finsh{
				text-align: center;
				padding-top: 40rpx;
				margin-top: 40rpx;
				image{
					float: none;
					margin: 0 auto;
				}
				.content{
					padding-top: 40rpx;
					text-align: left;
				}
				.lists{
					padding: 20rpx 0;
				}
				.lists2{
					border-bottom: 2rpx solid #e4e5ed;
				}
			}
			.icon{
			    position: absolute;
			    width: 26rpx;
			    height:26rpx;
			    background: url() no-repeat center center;
			    right: 20rpx;
			    top: 88rpx;	
			}
			
		}
		
	}
</style>
